<template>
  <div v-loading="showLoading">
    <div>
      <div class="fx">
        <div class="block f5bg">
          <div class="block-left">公司名称：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.enterpriseName }"
          ></div>
        </div>
        <div class="block f5bg">
          <div class="block-left">所属省份：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.provinceName }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block">
          <div class="block-left">税务密码：</div>
          <div class="block-right">
            {{ detailInfo.matchType == 1 ? basicInfo.creditPwd : "-" }}
          </div>
        </div>
        <div class="block">
          <div class="block-left">税号：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.creditCode }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block f5bg">
          <div class="block-left">联系方式：</div>
          <div class="block-right" v-htmlNo="{ action: basicInfo.phone }"></div>
        </div>
        <div class="block f5bg">
          <div class="block-left">法人：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.legalPerson }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block">
          <div class="block-left">成立日期：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.registerDate }"
          ></div>
        </div>
        <div class="block">
          <div class="block-left">成立时长：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.registerMonth, unit: '个月' }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block f5bg">
          <div class="block-left">法人是否变更：</div>
          <div class="block-right">
            {{ basicInfo.legalChangeStatus ? "有" : "无" }}
          </div>
        </div>
        <div class="block f5bg">
          <div class="block-left">法人股份占比：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.stockPercent, unit: '%' }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block">
          <div class="block-left">所属行业：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.industry }"
          ></div>
        </div>
        <div class="block">
          <div class="block-left">注册类型：</div>
          <div
            class="block-right"
            v-htmlNo="{ action: basicInfo.loginRegisterType }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block f5bg">
          <div class="block-left">是否小微企业：</div>
          <div class="block-right">
            {{ basicInfo.smallStatus == 0 ? "否" : "是" }}
          </div>
        </div>
        <div class="block f5bg">
          <div class="block-left">有无环保处罚：</div>
          <div class="block-right">
            {{ !basicInfo.envStatus ? "无" : "有" }}
          </div>
        </div>
      </div>
    </div>
    <div class="canpanyer-box" style="margin-top: 20px">
      <div class="title-msg">股东明细</div>

      <div style="margin-top: 20px">
        <el-table :data="basicInfo.qccEnterprisePartnersList" border>
          <el-table-column align="center" prop="stockName" label="股东名称">
          </el-table-column>
          <el-table-column align="center" prop="type" label="股东类型">
            <template slot-scope="scope" v-htmlNo="scope.row.stockType">
              {{ scope.row.stockType }}
            </template>
          </el-table-column>
          <el-table-column align="center" prop="money" label="认缴出资金额">
            <template slot-scope="scope" v-htmlNo="scope.row.shouldCapi">
              {{ scope.row.shouldCapi }}万
            </template>
          </el-table-column>
          <el-table-column align="center" prop="bl" label="出资比例">
            <template slot-scope="scope" v-htmlNo="scope.row.stockPercent">
              {{ scope.row.stockPercent }}%
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>
<script>
import { getEnterpriseReport } from "@/api/customer";
import { formatDateYear } from "@/utils/date";
export default {
  name: "basicInfo",
  props: {
    detailInfo: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      basicInfo: {},
      showLoading: false,
    };
  },
  created() {
    this.getCmsMatchDetailInfo();
  },
  methods: {
    getCmsMatchDetailInfo() {
      this.showLoading = true;
      let obj = this.$store.state.transmit;
      let params = {
        enterpriseId: this.detailInfo.id || obj.id,
        createTime: formatDateYear(new Date()),
      };
      getEnterpriseReport(params)
        .then((res) => {
          this.showLoading = false;
          this.basicInfo = res.data;
        })
        .finally(() => {
          this.$emit("loading", false);
        });
    },
  },
};
</script>

<style scoped lang="scss">
.f5bg {
  background: #f5f5f5;
}
.fx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  .block {
    width: 48%;
    display: flex;
    align-items: center;
    max-height: 60px;
    padding: 18px 0;

    //line-height: 56px;
    .block-left {
      display: inline-block;
      //display: flex;
      text-align: right;
      width: 38%;
      white-space: nowrap;
      color: #999;
    }
    .block-right {
      display: inline-block;
      //display: flex;
      line-height: 18px;
      color: #222;
      width: 60%;
    }
  }
}
.title-msg {
  font-size: 18px;
  font-weight: 500;
  color: #222222;
}
</style>
